package com.example.practicespring.domain;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.Dictionary;
import java.util.List;
import java.util.Map;

import lombok.Builder;
import lombok.Data;

/**
 * 服务器任务表
 * @TableName server_task
 */
@TableName(value ="server_task")
@Data
public class ServerTask implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 服务器id
     */
    private Integer sid;

    /**
     * 任务时间段
     */
    private String taskTime;

//可选时间段
    @TableField(exist = false)
    private List<String> timeList;

//    options选项
    @TableField(exist = false)
    private List<Map<String, String>> options;

    /**
     * 任务名称
     */
    private String taskName;

    /**
     * 更新时间
     */
    private Date updatetime;

    /**
     * 
     */
    private String servername;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ServerTask other = (ServerTask) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSid() == null ? other.getSid() == null : this.getSid().equals(other.getSid()))
            && (this.getTaskTime() == null ? other.getTaskTime() == null : this.getTaskTime().equals(other.getTaskTime()))
            && (this.getTaskName() == null ? other.getTaskName() == null : this.getTaskName().equals(other.getTaskName()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()))
            && (this.getServername() == null ? other.getServername() == null : this.getServername().equals(other.getServername()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSid() == null) ? 0 : getSid().hashCode());
        result = prime * result + ((getTaskTime() == null) ? 0 : getTaskTime().hashCode());
        result = prime * result + ((getTaskName() == null) ? 0 : getTaskName().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        result = prime * result + ((getServername() == null) ? 0 : getServername().hashCode());
        return result;
    }

    @Override
    public String toString() {
        return "ServerTask{" +
                "id=" + id +
                ", sid=" + sid +
                ", taskTime='" + taskTime + '\'' +
                ", timeList=" + timeList +
                ", taskName='" + taskName + '\'' +
                ", updatetime=" + updatetime +
                ", servername='" + servername + '\'' +
                '}';
    }
}